package com.wangyi.fightimg.base;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.PopupWindow;

import com.wangyi.fightimg.R;

/**
 * @author wangYi
 *         PopupWindow基类
 */
public class BasePopupWindow extends PopupWindow {
    protected View view;
    private Context context;

    public BasePopupWindow(Context context, int layout, final int topViewID) {

        this.context = context;
        view = View.inflate(context, layout, null);
        setContentView(view);
        setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
        setAnimationStyle(R.style.popup_anim);

        setFocusable(true);
        ColorDrawable colorDrawable = new ColorDrawable(0xb0000000);
        this.setBackgroundDrawable(colorDrawable);
    }
}
